var App =  getApp();

Component({
  data: {},
  properties: {
    addrList: {
      type: Array,
      value: []
    }
  },
  pageLifetimes: {
    // 组件所在页面的生命周期函数
    show: function () {
      const _this = this 
      App.globalData.userModel.addrList().then(json=>{
        _this.setData({ addrList: json.data})
      })
     },
    hide: function () { },
    resize: function () { },
  },

  methods: {
    addAddr: function () {
      wx.navigateTo({
        url: '/pages/person/location/info/info',
        success: (result) => {

        },
        fail: () => { },
        complete: () => { }
      });
    },
    goAddrInfo(event){
      wx.navigateTo({
        url: '/pages/person/location/info/info?item='+JSON.stringify(event.currentTarget.dataset.id),
      });
    },
    selectAdd(event){
      this.triggerEvent("selectAdd",event.currentTarget.dataset.item);
    }
  }
})